﻿using Game;
using GameEntitySystem;
using TemplatesDatabase;

namespace Mekiasm
{
    public class ComponentCoalGenerator : ComponentEnergyMachine
    {
        public ComponentCoalGenerator()
        {
            AllowChangeElectricMode = false;
            AllowChangeItemMode = true;
            AllowChangeGasMode = false;
            AllowChangeFluidMode = false;
        }

        public override bool CanAcceptFuel(int slotIndex, int fuelValue)
        {
            return false;
        }

        public override int GetSlotCapacity(int slotIndex, int value)
        {
            int id = Terrain.ExtractContents(value);
            var block = BlocksManager.Blocks[id];
            if (slotIndex == 1 && block.GetFuelFireDuration(value) <= 0) return 0;
            else return block.GetMaxStacking(value);
        }

    }
}

